Skip to content

refactor(framework): introduce component-based application architecture#15

Merged
jinliyl merged 6 commits into
mainfrom
dev/0625
Jun 26, 2026
Merged

refactor(framework): introduce component-based application architecture#15
jinliyl merged 6 commits into
mainfrom
dev/0625

Conversation

@jinliyl

@jinliyl jinliyl commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Background

This PR is a large framework-level refactor, so I updated the PR title to follow the repository contribution guideline's Conventional Commits format:

refactor(framework): introduce component-based application architecture

The change moves FlowLLM away from the older core / op / gallery / extensions layout and consolidates the runtime around the documented main path:

CLI / Client -> Service -> Application -> Job -> Step -> Component

Target behavior

The intended direction appears to be a cleaner, configuration-driven application framework:

  • flowllm.application.Application becomes the main entry point for wiring services, components, and jobs.
  • Reusable infrastructure lives under flowllm/components/ and is built around BaseComponent.
  • Atomic executable units live under flowllm/steps/ and can be composed into Jobs.
  • Implementations are resolved through the component registry and backend names instead of the previous flow/op package structure.
  • Default behavior is centralized in flowllm/config/default.yaml, keeping the default flowllm start path discoverable.
  • Public runtime models are moved into focused packages such as flowllm.schema, flowllm.enumeration, flowllm.config, and flowllm.utils.

Impact scope

This is best reviewed as a major architectural reset rather than a narrow refactor.

The PR:

  • Adds the new component architecture, including lifecycle management, dependency binding, registry lookup, application/runtime context, services, clients, jobs, embedding support, and agent wrappers.
  • Adds built-in Jobs and Steps for version, health check, help, demo, add, and streaming demo behavior.
  • Reworks config parsing to support named config discovery, YAML/JSON loading, keyword overrides, deep merge behavior, and environment expansion with ${ENV_VAR} / ${ENV_VAR:-default}.
  • Refreshes README content and adds English/Chinese documentation for quick start, framework concepts, contribution guidance, and architecture diagrams.
  • Reorganizes tests into tests/unit and tests/integration.
  • Removes large deprecated surfaces, including much of the previous flowllm.core, flowllm.extensions, flowllm.gallery, legacy vector store code, older docs, and the old/ tree.

Because of the package removals, this should be treated as a breaking change for users importing old modules directly.

Test plan

The PR adds or updates coverage for:

  • BaseComponent lifecycle and dependency injection behavior.
  • Component registry registration and lookup.
  • Runtime context and application config models.
  • Config parser behavior, including dot-notation overrides and environment expansion.
  • Service behavior and CLI argument handling.
  • Common built-in Steps.
  • Integration coverage for agent session persistence and forked sessions.

Before merge, the expected validation should match the contribution guide:

pre-commit run --all-files
pytest

For focused checks:

pytest tests/unit
pytest tests/integration

One CI issue should be fixed or confirmed: .github/workflows/unittest.yml currently installs pip install -e ".[dev,core]", but pyproject.toml defines dev, claude-code, and full extras, not core. If the core extra was intentionally removed, CI should probably use .[dev] or .[full].

Review focus

I recommend reviewers focus on these boundaries:

  • Whether the new public imports from flowllm.__init__, flowllm.application, flowllm.components, flowllm.schema, and flowllm.steps are the intended stable API.
  • Whether removing flowllm.core, flowllm.extensions, and flowllm.gallery is acceptable for this release.
  • Whether every default backend in flowllm/config/default.yaml is registered through @R.register(...) and imported by the relevant __init__.py.
  • Whether the package entry point flowllm = flowllm.application:main covers the intended quick-start path.
  • Whether tests that require LLMs, embeddings, or external services clearly document the required environment, as requested by the contribution guide.

jinliyl added 6 commits June 26, 2026 01:20
…nal method names

- Remove unused find_flowllm import and export from utils module
- Rename parse_env_file to _parse_env_file to indicate internal usage
- Rename get_version to _get_version in logo_utils to indicate internal usage
- Rename locate_flowllm to _locate_flowllm in service_utils to indicate internal usage
- Update all references to use new private method names
- Clean up formatting in various function definitions by removing unnecessary indentation
- Fix exponentiation operator syntax from 2 ** attempt to 2**attempt
- Adjust slice notation from i: i + size to i : i + size for consistency
- Remove deprecated traverse step tests from common steps unit tests
- Remove unused cosine_similarity import from embedding integration tests
- Remove unused default config test for daily write job registration
- Add new CLI unit test for call_server client kwargs passing
…n clarity

- Consolidated imports and removed unnecessary blank lines across multiple files
- Simplified docstrings to be more concise while preserving essential information
- Removed unused variables and redundant comments throughout the codebase
- Updated WorkspaceEnv to look for session-state files in session/ instead of resource/
- Modified AsAgentWrapper to remove verbose logging and streamline session handling
- Adjusted BackgroundJob docstring to be more focused on core functionality
- Removed unused import and simplified method signatures in various components
- Refactored Application class to reduce directory creation and simplify component initialization
- Updated test fixture documentation to be more direct and clear
- Removed auto-dream-and-proactive.svg flow chart
- Removed auto-index-and-memory-search.svg flow chart
- Removed auto-memory-resource.svg flow chart
- Removed old auto_cognition_design.md document
- Cleaned up deprecated visualization assets
- Removed redundant design documentation files
- Create contributing guidelines with development conventions and commit standards
- Add detailed framework documentation covering directory structure and architecture
- Include quick start guide with installation and basic usage instructions
- Add architecture diagrams for visual representation of FlowLLM framework
- Document service registration, job execution, and component lifecycle patterns
- Condensed core features description for better readability
- Removed detailed technical explanations from feature list
- Simplified open source and contributing section
- Removed conventional commits examples from README
- Added star history chart to both English and Chinese README
- Updated license description to be more concise
@jinliyl jinliyl changed the title Refactor utils and flowllm, improve documentation clarity Refactor FlowLLM into a component-based application framework Jun 26, 2026
@jinliyl jinliyl changed the title Refactor FlowLLM into a component-based application framework refactor(framework): introduce component-based application architecture Jun 26, 2026
@jinliyl
jinliyl merged commit ca41cf2 into main Jun 26, 2026
5 checks passed
@jinliyl
jinliyl deleted the dev/0625 branch June 26, 2026 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant